-
Notifications
You must be signed in to change notification settings - Fork 814
[go] Honor ClientOptions.UseStdio = false #296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Updates the Go SDK client initialization so ClientOptions.UseStdio = false is explicitly representable and results in spawning the CLI server and communicating over TCP (instead of stdio).
Changes:
- Change
ClientOptions.UseStdiofromboolto*boolto distinguish “unset” from an explicitfalse. - Add
Client.useStdioas the resolved transport mode and use it when starting/connecting to the CLI server. - Update unit/e2e tests to use
Bool(true/false)and validate the resolved transport mode.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| go/types.go | Makes UseStdio tri-state (*bool) to allow honoring explicit false without breaking defaults. |
| go/client.go | Resolves transport mode into Client.useStdio and switches startup/connection logic to use it. |
| go/client_test.go | Updates URL parsing / option resolution assertions to use client.useStdio and adds new cases. |
| go/e2e/client_test.go | Updates e2e client construction to use Bool(...) for UseStdio. |
Comments suppressed due to low confidence (1)
go/client.go:153
- Option precedence changed:
options.Port > 0forces TCP (client.useStdio = false), but a lateroptions.UseStdio != nilassignment can flip it back to stdio, leavingPortset but unused. Either validate this as an invalid combination (Port with UseStdio=true) or enforce a deterministic precedence (e.g., Port always implies TCP).
if options.Port > 0 {
opts.Port = options.Port
// If port is specified, switch to TCP mode
client.useStdio = false
}
if options.LogLevel != "" {
opts.LogLevel = options.LogLevel
}
if len(options.Env) > 0 {
opts.Env = options.Env
}
if options.UseStdio != nil {
client.useStdio = *options.UseStdio
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
copilot.ClientOptions{UseStdio: false}should create a client that starts a CLI server and talks to it via TCP instead of stdio.